# Compiler settings
CC = gcc
CFLAGS = -Wall -Wextra -pedantic -std=c11 -O2 -g 
PKG_CONFIG = pkg-config

# AT-SPI package configuration
ATSPI_CFLAGS = $(shell $(PKG_CONFIG) --cflags atspi-2)#获取编译 AT-SPI 程序所需的编译器标志
ATSPI_LIBS = $(shell $(PKG_CONFIG) --libs atspi-2) -lgobject-2.0#获取链接 AT-SPI 程序所需的库标志

# Targets
TARGET = atspi-demo
SRC = main.c

# Default target
all: $(TARGET)

# Build executable
$(TARGET): $(SRC)
	$(CC) $(CFLAGS) $(ATSPI_CFLAGS) -o $@ $< $(ATSPI_LIBS)

# Clean build artifacts
clean:
	rm -f $(TARGET)

# Run the program
run: $(TARGET)
	./$(TARGET)

# Help information
help:
	@echo "Available targets:"
	@echo "  all     - Build the program (default)"
	@echo "  clean   - Remove build artifacts"
	@echo "  run     - Build and run the program"
	@echo "  help    - Show this help message"

.PHONY: all clean run help